import request from '@/api/utils/request';

/**
 * 请假列表
 * {
  "size": 10,
  "current": 1,
  "orders": [
         {
            "column": "create_time",
            "asc": false
        }
    ],
  "data": {
    "userIds": [],  // 先不传
    "beginTime": "", // 开始时间
    "endTime": "", // 结束时间
    "timeArrange": [ ],  // 时间范围先不传
    "gradeId": null, // 年级ID
    "classId": null, // 班级ID
    "studentName": "", // 学生姓名
    "dormitoryId": null, // 宿舍楼ID
    "roomId": null // 房间ID
    "status": null, //请假状态
  }
}
 */
export const listLeaveRecord = data =>
  request({
    method: 'POST',
    url: '/schLeave/listLeaveRecord',
    data
  });

/**
 * 导出
 * {
  "recordList": [
    {
      "studentName": "",
      "dormitoryName": "",
      "dormitoryRoomName": "",
      "className": "",
      "leaveReason": "",
      "leaveTime": "",
      "createTime": "",
      "status": ""
    }
  ]
}
 * */
export const exportLeaveRecord = data =>
  request({
    method: 'POST',
    url: 'schLeave/exportLeaveRecord',
    data,
    responseType: 'blob'
  });
